package com.fuint.common.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.fuint.common.service.WeixinService;
import com.fuint.framework.exception.BusinessCheckException;
import com.fuint.framework.web.ResponseObject;
import com.fuint.repository.model.MtOrder;
import com.fuint.repository.model.MtUser;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.Collections;
import java.util.Date;
import java.util.Map;

/**
 * 微信相关接口
 *
 * Created by FSQ
 * CopyRight https://www.fuint.cn
 */
@Service
@AllArgsConstructor(onConstructor_= {@Lazy})//配置懒加载，因为后面会用到其他service层的bean。在容器装配时可能会造成循环依赖的问题
public class WeixinServiceImpl implements WeixinService {

    private static final Logger logger = LoggerFactory.getLogger(WeixinServiceImpl.class);




    @Override
    public String getAccessToken(Integer merchantId, boolean isMinApp, boolean useCache) throws BusinessCheckException {
        return "";
    }

    @Override
    public ResponseObject createPrepayOrder(MtUser userInfo, MtOrder orderInfo, Integer payAmount, String authCode, Integer giveAmount, String ip, String platform, String isWechat) throws BusinessCheckException {
        return null;
    }

    @Override
    public Map<String, String> processResXml(HttpServletRequest request) {
        return Collections.emptyMap();
    }

    @Override
    public void processRespXml(HttpServletResponse response, boolean flag) {

    }

    @Override
    public JSONObject getWxProfile(Integer merchantId, String code) throws BusinessCheckException {
        return null;
    }

    @Override
    public JSONObject getWxOpenId(Integer merchantId, String code) throws BusinessCheckException {
        return null;
    }

    @Override
    public String getPhoneNumber(String encryptedData, String sessionKey, String iv) {
        return "";
    }

    @Override
    public Boolean sendSubscribeMessage(Integer merchantId, Integer userId, String toUserOpenId, String key, String page, Map<String, Object> params, Date sendTime) throws BusinessCheckException {
        return null;
    }

    @Override
    public Boolean doSendSubscribeMessage(Integer merchantId, String reqDataJsonStr) {
        return null;
    }

    @Override
    public Map<String, String> queryPaidOrder(Integer storeId, String transactionId, String orderSn) {
        return Collections.emptyMap();
    }

    @Override
    public Boolean doRefund(Integer storeId, String orderSn, BigDecimal totalAmount, BigDecimal refundAmount, String platform) throws BusinessCheckException {
        return null;
    }

    @Override
    public String createQrCode(Integer merchantId, String type, Integer id, String page, Integer width) throws BusinessCheckException {
        return "";
    }

    @Override
    public String createWxCard(Integer merchantId, String wxCardId) throws BusinessCheckException {
        return "";
    }

    @Override
    public String createCardQrCode(Integer merchantId, String cardId, String code) {
        return "";
    }

    @Override
    public Boolean isOpenCard(Integer merchantId, String cardId, String openId) {
        return null;
    }

    @Override
    public String createMiniAppLink(Integer merchantId, String path) {
        return "";
    }
}
